#lang racket


(require "../config/main.rkt")

(require "constructor-imediate.rkt")

(provide render)


(define (render-impl node file dir ext width height type)
  (begin0
    (evaluate node)
    (let ((path (format "~A~A.~A" (path->string dir) file ext)))
      (displayln (format "Render (~Ax~A) ~A" width height path))
      (render-shapes width height path type))))

(define (render shape/shapes file
                #:dir (dir (render-dir))
                #:ext (ext (render-ext))
                #:width (width (render-width))
                #:height (height (render-height))
                #:type (type (cfg-render-type)))
  (render-impl shape/shapes file dir ext width height type))